package toubiao.domain.po.utility;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "province")
@DynamicInsert(true)
@DynamicUpdate(true)
public class PoProvince {

	private Long id;
	
	private String name;
	
	private int seq;
	
	private Set<PoCity> citySet;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "province")
	public Set<PoCity> getCitySet() {
		return citySet;
	}

	public void setCitySet(Set<PoCity> citySet) {
		this.citySet = citySet;
	}
}
